import { getMedicalOrderDetail } from '@/apis/order'
import type { MedicalOrderDetail } from '@/types/order'
import { ref } from 'vue'

export const useMedic = (id: string) => {
  // 1. 药品订单详情
  const orderDetail = ref({} as MedicalOrderDetail)

  // 查询订单详情
  const getOrderDetail = async () => {
    // 订单详情接口
    const data = await getMedicalOrderDetail(id)
    // 渲染订单数据
    orderDetail.value = data
  }

  getOrderDetail()

  return {
    orderDetail,
  }
}